package com.imooc.admin.service.impl;

import com.imooc.admin.repository.FriendLinkRepository;
import com.imooc.admin.service.FriendLinkService;
import com.imooc.enums.YesOrNo;
import com.imooc.pojo.mo.FriendLinKMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @auther Levi
 * @Date: 2021/03/21/17:05
 * @Description:
 */
@Service
public class FriendLinkServiceImpl implements FriendLinkService {
    @Autowired
    private FriendLinkRepository friendLinkRepository;
    
    @Override
    public void saveOrUpdateFriendLink(FriendLinKMO friendLinKMO) {
        friendLinkRepository.save(friendLinKMO);
    }
    @Override
    public List<FriendLinKMO> getFriendLinkList() {
        List<FriendLinKMO> list = friendLinkRepository.findAll();
        return list;
    }
    @Override
    public void delete(String linkId) {
        friendLinkRepository.deleteById(linkId);
    }
    @Override
    public List queryPortalFriendLinkList(Integer isDelete) {
        List<FriendLinKMO> allByIsDelete = friendLinkRepository.getAllByIsDelete(isDelete);
        return allByIsDelete;
    }
}
